package com.itheima.methodinference;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Student {
    private String name;
    private int age;
    private int score;

    //实例方法
    public int compareByScore(Student s1, Student s2) {
        return s1.getScore() - s2.getScore();
    }
    //静态方法
    public static int compareByAge(Student s1, Student s2) {
        return s1.getAge() - s2.getAge();
    }
}
